<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


    <script>

        const users = [1, 2, 3, 4, 5, 6, 7];

        users.sort((a, b) => {
            if (a > b) {
                return 1
            } else {
                return -1
            }
        });

        console.log(users);

    </script>
</body>

</html>